package com.fagp.mew.cms.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.HandlerMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class PageController {

    @RequestMapping("/login")
    public String login() {
        return "login";
    }

    @RequestMapping("/drag")
    public String drag() {
        return "drag";
    }

    @RequestMapping("/page/**")
    public String page(HttpServletRequest request) {
        String path = request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE).toString();
        path = path.replace("/page/","");
        return path;
    }



}
